package com.ft.oa.web.customer;


import com.ft.oa.domain.customer.CustomerOrganiza;
import com.ft.oa.domain.dto.ApiResult;
import com.ft.oa.service.customer.CustomerOrganizaService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;


@RestController
@RequestMapping("/customer/organiza")
public class CustomerOrganizaController {

    @Resource
    private CustomerOrganizaService customerOrganizaService;

    /**
     * 公司组织架构展示
     * @param customerOrganiza
     * @return
     */
    @PostMapping("/select")
    public ApiResult select(@RequestBody CustomerOrganiza customerOrganiza){
        Map<String, Object> select = customerOrganizaService.select(customerOrganiza);
        return ApiResult.successWithData(select);
    }

    /**
     *  添加公司人员信息
     */
    @PostMapping("/inter")
    public ApiResult inter(@RequestBody CustomerOrganiza customerOrganiza){
        customerOrganizaService.insert(customerOrganiza);
        return ApiResult.simpleSuccess();
    }

}
